<?php
    echo form_open('', array('id' => 'cat_home_form'), array('cat_id' => 0, 'from_list' => TRUE));
    echo isset ($uri) ? form_hidden('uri', $uri) : NULL;
    echo form_hidden('back_url', '/dashboard/news/categories/');
    echo form_close();
?>
<div class="page_header">
    <h1 class="fleft">Sắp xếp danh mục bài viết trang chủ</h1>
    <small class="fleft">"Thay đổi vị trí các danh mục ngoài trang chủ"</small>
    <br class="clear"/>
</div>
<div class="form_content">
    <div id="sort_home_cat" class="sortable">
        <table class="list" style="width: 100%">
        <?php $this->load->view('powercms/message'); ?>
        <tr>
            <th class="left">ID</th>
            <th class="left">TÊN DANH MỤC</th>
            <th class="left">ĐƯỜNG DẪN</th>
        </tr>
        </table>
        <ul>
            <?php foreach($categories as $index => $cat):
                $uri            = $lang . '/' . url_title($cat->category, 'dash', TRUE) . '-n' .$cat->id;
                if($cat->parent_id == 0) $style = 'odd';
                else $style = 'even';
            ?>
            <li id="id_<?php echo $cat->id; ?>">
                <div class="id_cat"><?php echo $cat->id; ?></div>
                <div class="name_cat"><a href="<?php echo $uri;?>"><?php echo $cat->category; ?></a></div>
                <div class="cat_position"><?php echo $uri;?></div>
            
            </li>
            
            <?php endforeach; ?>
            
        </ul>
        
    </div>
    
    <br class="clear"/>&nbsp;
</div>